package com.suredy.app.porject.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.suredy.app.porject.constants.BidStatus;
import com.suredy.core.model.BaseModel;

/**
 * 中标结果
 * 
 * @author VIVID.G
 * @since 2015-11-3
 * @version v0.1
 */
@Entity
@Table(name = "tb_bid_result")
public class BidResult extends BaseModel {

	private static final long serialVersionUID = 1L;

	/* 投标状态 */
	@Column(length = 20)
	@Enumerated(EnumType.STRING)
	private BidStatus status;

	/* 中标单位 */
	@Column(name = "win_company", length = 200)
	private String winCompany;

	/* 中标价 */
	@Column(name = "final_money", columnDefinition = "double(255,2) default 0.00")
	private Double finalMoney;

	/* 中标金额说明文字，适用于单价和降点 */
	@Column(name = "final_money_desc", length = 1000)
	private String finalMoneyDesc;

	/* 开标时间 */
	@Column(name = "opening_time", nullable = false)
	private Date openingTime;

	/* 公示时间 */
	@Column(nullable = false)
	private Date time;

	/* 备注 */
	@Column(length = 3000)
	private String remark;

	/* 关联的招标信息 */
	@JsonIgnore
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name = "bid_id")
	private Bid bid;

	public BidStatus getStatus() {
		return status;
	}

	public void setStatus(BidStatus status) {
		this.status = status;
	}

	public String getWinCompany() {
		return winCompany;
	}

	public void setWinCompany(String winCompany) {
		this.winCompany = winCompany;
	}

	public Double getFinalMoney() {
		return finalMoney;
	}

	public void setFinalMoney(Double finalMoney) {
		this.finalMoney = finalMoney;
	}

	public String getFinalMoneyDesc() {
		return finalMoneyDesc;
	}

	public void setFinalMoneyDesc(String finalMoneyDesc) {
		this.finalMoneyDesc = finalMoneyDesc;
	}

	public Date getOpeningTime() {
		return openingTime;
	}

	public void setOpeningTime(Date openingTime) {
		this.openingTime = openingTime;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Bid getBid() {
		return bid;
	}

	public void setBid(Bid bid) {
		this.bid = bid;
	}

}
